home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / prof.zip / PROF.DOC < prev    next >
Text File  |  1991-08-23  |  6KB  |  134 lines

  1.  
  2.  
  3.  
  4. NAME
  5.      prof - a program for profiling .COM & .EXE programs.
  6.  
  7. SYNOPSIS
  8.      prof [ options ] cmd [ args ]
  9.  
  10. DESCRIPTION
  11.      Prof is a program that collects information about where a
  12.      program spends most of its time executing, and a few other
  13.      things. It is not dependent of a specifiec compiler or
  14.      language, but requires a standard mapfile to be any useful.
  15.      Assembler programs work fine, but not with mixed near/far
  16.      calls if you use the `-m' switch. The results of the profile
  17.      are not affected by the time it takes to load the profiled
  18.      program from disk.
  19.  
  20. OPTIONS
  21.      -2   Assume near function calls; that is, the program to be
  22.           profiled should have been compiled under the Tiny,
  23.           Small or Compact memory models. Near function calls are
  24.           assumed by default.
  25.           This switch is meaningful only in combination with the
  26.           `-m' switch.
  27.  
  28.      -4   Assume far function calls, i.e. Medium, Large or Huge
  29.           memory models. Otherwise as for `-2'.
  30.  
  31.      -Ad  Set the sampling precision to d, where d is a digit
  32.           between 1 and 9 inclusive. 1 means maximum precision,
  33.           9 means minimum. If d is not specified, a precision of
  34.           1 is set by default. If this switch is not specified
  35.           at all, a sampling precision slightly worse than 9 is
  36.           applied.
  37.           Note that the sampling is not performed more *often*
  38.           when a higher precision is used; the sampler is rather
  39.           wasting more time in a delay loop (i.e. the clock freq-
  40.           uency is not adjusted). The happy effect of this is
  41.           that it works on the 8086/8088, the boring effect is
  42.           that the profiled command might run *very* slowly.
  43.           This switch is maningful only in combination with `-f'
  44.           or `-l'.
  45.  
  46.      -Mx  Use mapfile `x' instead of the default name, which is
  47.           diverged from the command name by appending ``map''.
  48.  
  49.      -a   Sort the output by address.
  50.  
  51.      -c   Count the number of calls to each function.
  52.  
  53.      -d   Count the number of calls to each DOS function
  54.           (int 21h), and subfunctions where that is applicable.
  55.           You won't get symbolic names, though. Does not require
  56.           a mapfile.
  57.  
  58.      -f   Estimate the relative time spent in each function and
  59.           DOS/BIOS areas. This is the default operation of the
  60.           profiler. May produce strange output if there are a lot
  61.           of static (or private) functions in the program. This
  62.           applies certainly to the runtime library.
  63.           Does not require a mapfile to report DOS/BIOS areas
  64.           versus the code executed in the command itself.
  65.  
  66.      -i   Interactive turn profiling on and off by use of the
  67.           key combinations Alt+ (on) and Alt- (off). Profiling
  68.           is off at startup.
  69.  
  70.      -j   As `-i', but profiling is on at startup.
  71.  
  72.      -k   Count the number of times each line executes.
  73.  
  74.      -l   Estimate the relative time spent executing each line
  75.           in the program. Every sample that doesn't match a line
  76.           is labeled ``Runtime library'' in the output.
  77.  
  78.      -mx  Track down all calls to function `x' and report where
  79.           they came from. This may *really* produce funny results
  80.           if there are a lot of static functions. C programmers:
  81.           remember to prepend the underscore!
  82.  
  83.      -n   Sort the output by name. Not applicable when profiling
  84.           line numbers or counting DOS calls.
  85.  
  86.      -ox  Use output file `x' instead of the default name, which
  87.           is diverged from the command name by appending ``prf''.
  88.  
  89.      -q   Sort the output by frequency. This is the default.
  90.  
  91.      -s   Swap the names collected from the mapfile to disk upon
  92.           execution of the command. This to free up some core.
  93.  
  94.      -v   Verbose. Report memory usage and exit status of
  95.           profiled command.
  96.  
  97.      -w   Some compilers produce strange line number information
  98.           in the mapfile. This includes different line numbers
  99.           with the same address, and the same line number/address
  100.           pair repeated. In each of these cases the duplicate
  101.           information is discarded. `-w' means to give a warning
  102.           each time this happens.
  103.  
  104.      -z   List also items that had zero frequency. Not applicable
  105.           to DOS calls.
  106.  
  107.      cmd  The command to be profiled, may be a .COM or an .EXE
  108.           program. Full path name must be supplied.
  109.  
  110.      args Arguments to profiled command.
  111.  
  112.      The switches `-c', `-d', `-f', `-k', `-l' and `-m' are
  113.      mutually exclusive, as are also `-a', `-n' and `-q'.
  114.  
  115. LIMITS
  116.      The current version has a maximum limit of 5458 functions or
  117.      lines. The line maximum is too restrictive, so this might be
  118.      classified as a bug.
  119.  
  120. BUGS
  121.      The results of the `-c' switch may vary slightly from run to
  122.      run (they are too high), especially for functions that are
  123.      called a lot of times. Why this happens is beyond my under-
  124.      standing, but the variations are so small (0.01%) that the
  125.      effect should be zero. The same appears for the `-k' switch.
  126.  
  127.      The profiler might hang when a high sampling precision is
  128.      used. This *should* never happen, but anyway it does.
  129.  
  130. ACKNOWLEDGEMENTS
  131.      This program is a major rewrite of Bjorn Larsson's profiler,
  132.      which i downloaded from somewhere some day. The original
  133.      version was only able to profile functions (`-f' switch).
  134.